package com.yuan.java.thread.multhread;

import java.util.concurrent.Callable;

/**
 * 带有返回值的线程
 * Created by yuan on 2017/7/25.
 */
public class CallableThread implements Callable<Integer> {

    private Integer i;

    public CallableThread(Integer i) {
        this.i = i;
    }

    @Override
    public Integer call() throws Exception {
        Thread.sleep(2000);
        System.out.println(Thread.currentThread().getName() + "hello world");
        return this.i;
    }
}
